package com.zff.rental.utils.sql.impl;

import com.zff.rental.utils.sql.Condition;
import com.zff.rental.utils.sql.Where;
import com.zff.rental.utils.sql.WhereNext;

/**
 * @author HCY
 */
class WhereImpl extends SqlContextHolder implements Where {
    public WhereImpl(SqlContext sqlContext) {
        super(sqlContext);
    }

    @Override
    public <T> WhereNext where(Condition<T> condition) {
        sqlContext.getSql().append(" WHERE ").append(condition.toSql());
        return sqlContext.getWhereNext();
    }

    @Override
    public <T> WhereNext where(String where, T... value) {
        // TODO: 自定义条件
        sqlContext.getSql().append(" WHERE ").append(where);
        return sqlContext.getWhereNext();
    }
}
